package com.icity.common;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlElement;

import com.fasterxml.jackson.annotation.JsonProperty;

public class Status implements Serializable {
	private static final long serialVersionUID = -2014592760065018707L;

	public static final Status OK = new Status(0, "操作成功");
	public static final Status SIGNATURE_ERROR = new Status(1021,
			"Account exception,contact your administrator please");// code 不能改变，不能重复！！
	public static final Status ERROR = new Status(1, "操作失败");
	public static final Status XSS_ERROR = new Status(600, "Parameter error");// 防sql注入,code 不能重复！
	public static final Status MODIFY_OK = new Status(100, "Your password has been changed");// 修改密码成功
	public static final Status Relieve_Bind_OK = new Status(200, " Your account is unbound from this device");// 解除绑定成功
	public static final Status INTERNAL_ERROR = new Status(1000, "Server internal error");// 服务器内部错误
	public static final Status PARAM_MISS = new Status(1001, "缺少参数");// Missing parameters
	public static final Status PARAM_ERROR = new Status(1002, "Parameter error");// 参数错误
	public static final Status OUT_OF_SERVICE = new Status(1003, "Service is not available");// 服务不可用
	public static final Status DELETE_FAIL = new Status(1004, "删除失败");// Failed to delete
	public static final Status DELETE_ROLE_FAIL = new Status(1004, "有用户关联该角色，无法删除");
	public static final Status DELETE_SHOP_FAIL = new Status(1004, "该商铺有品种价格数据，无法删除");
	public static final Status DELETE_MARKET_FAIL = new Status(1004, "该市场有模块关联,无法删除");
	public static final Status DELETE_VARIETIES_FAIL = new Status(1004, "该品种有模块关联，无法删除");
	public static final Status DELETE_TYPE_FAIL = new Status(1004, "该种类有关联数据，无法删除");

	public static final Status DELETE_SUCCESS = new Status(2000, "删除成功");// Successfully deleted
	public static final Status SAVE_FAIL = new Status(1005, "Save failed");// 保存失败
	public static final Status SAVE_SUCCESS = new Status(2001, "Saved successfully");// 保存成功
	public static final Status UPDATE_SUCCESS = new Status(2002, "更新成功");// Update completedupdate completed
	public static final Status SMS_SEND_FAIL = new Status(1006, "Failed to send text messages");// 发送短信失败
	public static final Status PARAM_TOO_LONG = new Status(1007, "参数太长");// Parameter too long
	public static final Status FILE_UPLOAD_FAIL = new Status(1008, "Failed to upload file");// 上传文件失败
	public static final Status FILE_NOT_EXISTS = new Status(1009, "File does not exist");// 文件不存在
	public static final Status USERNAME_ERROR = new Status(1010, "User Name error");// 用户名错误
	public static final Status USERNAME_NOT_EXISTS = new Status(1011, "用户不存在");// Username does not exist
	public static final Status PASSWORD_ERROR = new Status(1012, "Wrong password");// 密码错误
	public static final Status USER_ERROR = new Status(9999, "用户名或密码错误");// ERROR Incorrect username or password
	public static final Status USER_LOGIN = new Status(8888, "登陆成功");// Login successful
	public static final Status CAPTCHA_ERROR = new Status(1013, "Verification code error");// 验证码错误
	public static final Status NOT_SIGNIN = new Status(1014, "User is not logged in");// 用户未登录
	public static final Status USER_INVALID = new Status(1015, "用户被冻结");// The user is frozen
	public static final Status ACCESS_LIMITED = new Status(1016, "Access restricted");// 访问受限或权限不足
	public static final Status OPER_FAIL = new Status(1017, "Operation failed");// 操作失败
	public static final Status USERNAME_EXISTS = new Status(1018, "用户已经存在");// The user already exists
	public static final Status SIGNIN_TIMEOUT = new Status(1019, "Logon timeout");// 登录超时
	public static final Status UPDATE_FAIL = new Status(1020, "更新失败");// Update failed
	public static final Status FILE_UPLOAD_SUCCESS = new Status(2003, "Upload file successful");// 上传文件成功
	public static final Status PARAMSKEY_EXISTS = new Status(1022, "参数已经存在");// The parameter already exists
	public static final Status CONFIG_FAIL = new Status(1023, "Configuration failed");// 配置用户失败
	public static final Status INDEXCATEGORY_EXISTS = new Status(1024, "The indexCategory already exists");// 指标类型已存在
	public static final Status INDEXDEFINE_EXISTS = new Status(1025, "The index already exists");// 指标已经存在
	public static final Status MEETING_EXISTS = new Status(1026, "The title already exists");// 会议标题已存在
	public static final Status ORDER_FAIL = new Status(1027, "Order fail");// 排序失败
	public static final Status APP_VERSION_NEW = new Status(3000, "No need to update Setting");// 已是最新版本，无需更新
	public static final Status APP_VERSION_UPDATE = new Status(3001, "Update");// 需更新
	public static final Status REPORT_EXISTS = new Status(1028, "The report already exists");// 报告已存在
	public static final Status APP_REMIND_UPDATE = new Status(3002, "Remind time set successfully ");// 提醒时间设置成功
	public static final Status EMAIL_SEND_SUCCESS = new Status(2004, "Email sent");// 邮件发送成功
	public static final Status LOGIN_FAIL = new Status(1029,
			"Login failed, your account has been bound to another device");// 登录失败，请联系管理员
	public static final Status USER_TO_BE_ACTIVE = new Status(1030, " 待激活状态");// The user is to be activated
	public static final Status USER_ACTIVE = new Status(1031, "The user is atcive");// 活跃状态
	public static final Status USER_FREEZE = new Status(1032,
			" Your account is frozen, please try again one hour later");// 冻结状态
	public static final Status USER_FORGETPWD = new Status(1033, "Login failed, please retrieve your password");// 忘记密码状态
	public static final Status USER_PWD_ERROR = new Status(1034, "验证失败，与原密码不同");// Verification failed,different from
																				// the original password
	public static final Status USER_FIND_ERROR = new Status(1035, "verification failed,insufficient permissions");// 验证失败，权限不足
	public static final Status USER_ACCOUNT_FROZEN = new Status(1036, "Your account has been frozen");// 账户冻结
	public static final Status USER_ACCOUNT_DISABLED = new Status(1037, "You are not allowed to log in");// 账户禁用
	public static final Status USER_LOGIN_RETRY = new Status(1038,
			"Your account is frozen, please try again one hour later");// 错误次数达到5次
	public static final Status EQUIP_BIND_FAIL = new Status(1039,
			"Login failed,and the device is already bound to an account");// 设备已经绑定过帐号
	public static final Status ROLE_USED = new Status(1040, "角色已经存在");// The role already exists
	public static final Status USER_FORBIDDEN = new Status(1041, "You are not allowed to log in");// 禁用状态
	public static final Status USER_FROZEN = new Status(1042, "The account has been frozen");// 找回密码 冻结提示
	public static final Status RY_MEMBER_UPPER = new Status(2007, "The number of registered users exceeds the limit");// 注册用户数超限,请登录开发者管理后台增加注册用户数.
	public static final Status USER_ROLE_WRONG = new Status(2008, "Customer service must have Q & A permissions");// 客服必须有QA-service权限
	public static final Status SEND_FIAL = new Status(1042, "send fail,please try again");
	public static final Status SHOPNAME_EXISTS = new Status(1043, "商铺已经存在");
	public static final Status MARKETNAME_EXISTS = new Status(1044, "市场已经存在");
	public static final Status VARIETIESNAME_EXISTS = new Status(1045, "品种已经存在");
	public static final Status TYPENAME_EXISTS = new Status(1046, "种类已经存在");
	public static final Status SELECTED_TYPE = new Status(1047, "该种类下已关联品种，无法作为父类别被选中");

	protected Status() {
	}

	protected Status(int code, String message) {
		this.code = code;
		this.message = message;
	}

	@XmlElement
	private int code;

	@XmlElement
	private String message;

	public int getCode() {
		return code;
	}

	@JsonProperty("msg")
	public String getMessage() {
		return message;
	}

}
